package com.fjb.common.enums.product;

/**
 * @Description:交易类型  1、出售     2、求购
 * @author hemiao
 * @time:2020年1月4日 下午8:27:38
 */
public enum DealType {
	
	/**
	 *   1、出售
	 */
	TYPE_1(1,"出售"),
	
	/**
	 *  2、求购
	 */
	TYPE_2(2,"求购");
	
	private Integer code;
    private String msg;
	
	private DealType(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }
	
	public static String getTypeMsg(Integer code) {
    	if(code==null) {
    		return null;
    	}
        for (DealType o : DealType.values()) {
	        if (o.getCode() == code) {
	            return o.msg;
	        }
        }
        return null;
    }

	public Integer getCode() {
		return code;
	}

	public void setCode(Integer code) {
		this.code = code;
	}

	public String getMsg() {
		return msg;
	}

	public void setMsg(String msg) {
		this.msg = msg;
	}
}
